/*
 *  Copyright (C) 2010 Matthias Buch-Kromann <mbk.isv@cbs.dk>
 *
 *  This file is part of the MatrixParser package.
 *
 *  The MatrixParser program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.osdtsystem.matrixparser.features.keys;

/**
 *
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
public final class StringList7 extends AbstractStringList {
    String group = "";
    String f1 = "", f2 = "", f3 = "", f4 = "", f5 = "", f6 = "", f7 = "";

    public StringList7() {
    }

    public StringList7 copy() {
        return new StringList7().set(group, f1, f2, f3, f4, f5, f6, f7);
    }

    public StringList7 set(String group, String f1, String f2, String f3, String f4, String f5, String f6, String f7) {
        this.group = group;
        this.f1 = f1;
        this.f2 = f2;
        this.f3 = f3;
        this.f4 = f4;
        this.f5 = f5;
        this.f6 = f6;
        this.f7 = f7;
        this.hashcode = _hashCode();
        return this;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final StringList7 other = (StringList7) obj;
        if (! this.group.equals(other.group)) {
            return false;
        }
        if (! this.f1.equals(other.f1)) {
            return false;
        }
        if (! this.f2.equals(other.f2)) {
            return false;
        }
        if (! this.f3.equals(other.f3)) {
            return false;
        }
        if (! this.f4.equals(other.f4)) {
            return false;
        }
        if (! this.f5.equals(other.f5)) {
            return false;
        }
        if (! this.f6.equals(other.f6)) {
            return false;
        }
        if (! this.f7.equals(other.f7)) {
            return false;
        }
        return true;
    }

    @Override
    public int _hashCode() {
        int hash = 5;
        hash = 79 * hash + this.group.hashCode();
        hash = 79 * hash + this.f1.hashCode();
        hash = 79 * hash + this.f2.hashCode();
        hash = 79 * hash + this.f3.hashCode();
        hash = 79 * hash + this.f4.hashCode();
        hash = 79 * hash + this.f5.hashCode();
        hash = 79 * hash + this.f6.hashCode();
        hash = 79 * hash + this.f7.hashCode();
        return hash;
    }

    @Override
    public String toString() {
        StringBuilder s = new StringBuilder();
        s.append(group)
                .append(FIELDSEP).append(f1)
                .append(FIELDSEP).append(f2)
                .append(FIELDSEP).append(f3)
                .append(FIELDSEP).append(f4)
                .append(FIELDSEP).append(f5)
                .append(FIELDSEP).append(f6)
                .append(FIELDSEP).append(f7);
        return s.toString();
    }
}
